<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>sound</title>
  </head>
  <body bgcolor="#FFFFFF">
    <center>Scilab Function</center>
    <div align="right">Last update : 02/09/2005</div>
    <p>
      <b>sound</b> - sound player facility</p>
    <h3>
      <font color="blue">Calling Sequence</font>
    </h3>
    <dl>
      <dd>
        <tt>sound(y [,fs,bits,command)  </tt>
      </dd>
    </dl>
    <h3>
      <font color="blue">Parameters</font>
    </h3>
    <ul>
      <li>
        <tt>
          <b>y</b>
        </tt>: real vector</li>
      <li>
        <tt>
          <b>fs</b>
        </tt>: real number, sampling frequency in sample per second (default value is 22050)</li>
      <li>
        <tt>
          <b>bits</b>
        </tt>: real number, number of bits (unused)</li>
      <li>
        <tt>
          <b>command</b>
        </tt>: Only used on Unix systems it gives the name of the command to use for playing sound 
          (wav) files. The defaut value is <tt>
          <b>aplay</b>
        </tt>. If set <tt>
          <b>/dev/audio</b>
        </tt> then 
          a 8 bits mu-law raw sound file is created and send to <tt>
          <b>/dev/audio</b>
        </tt>
      </li>
    </ul>
    <h3>
      <font color="blue">Description</font>
    </h3>
    <p>
      <tt>
        <b>sound(y,fs)</b>
      </tt>plays the sound signal given by matrix <tt>
        <b>y</b>
      </tt> (with sample frequency
    fs). In fact this function is just a wrapper for <tt>
        <b>playsnd</b>
      </tt>. Values in y are assumed to be in the 
    range -1.0 &lt;= y &lt;= 1.0. Values outside that range are truncated.  
    The number of rows of <tt>
        <b>y</b>
      </tt> gives the number of channels.
    <tt>
        <b>sound(y)</b>
      </tt> plays the sound at the default sample rate of 22050 sample per second.
    <tt>
        <b>sound(y,fs,nbits)</b>
      </tt> plays the sound using <tt>
        <b>nbits</b>
      </tt> bits/sample if
    possible (it is in fact unused).  Most platforms support bits=8 or 16.</p>
    <h3>
      <font color="blue">Examples</font>
    </h3>
    <pre>

  // a two channel signal 
  y=loadwave('SCI/demos/signal/sound/chimes.wav');
  sound(y)
 
  </pre>
    <h3>
      <font color="blue">See Also</font>
    </h3>
    <p>
      <a href="playsnd.htm">
        <tt>
          <b>playsnd</b>
        </tt>
      </a>,&nbsp;&nbsp;</p>
  </body>
</html>
